package com.example.mybatis_.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

@Data
public class User {

    /**
     *  指定主键的方式如果为di可以不用写
     *  type 指定主键的类型
     */
    @TableId(value = "id" ,type = IdType.AUTO)
    private Integer id;

    private String name;

    private Integer age;

    private String email;


    public User(String name, Integer age, String email) {
        this.name = name;
        this.age = age;
        this.email = email;
    }

    public User() {
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", email='" + email + '\'' +
                '}';
    }
}
